class Solution(object):
    def strWithout3a3b(self, a, b):
        t = min(a, b)
        if a == t:
            i_c = 'a'
            w_c = 'b'
        else:
            i_c = 'b'
            w_c = 'a'
        n = a + b
        out = [w_c] * n
        for i in range(2, n, 3):
            if t > 0:
                out[i] = i_c
                t -= 1
            else:
                break
        index = 0
        while t > 0:
            out[index] = i_c
            index += 3
            t -= 1
        return ''.join(out)




data = Solution()
a = 4
b = 1
print(data.strWithout3a3b(a, b))
